%
O08705(BALLBAR RECOVERY)
(N-9967-2700-01) 
(COPYRIGHT*2024*RENISHAW*PLC.*ALL*RIGHTS*RESERVED) 

(WARNING!)
(Renishaw cannot guarantee that the part programs supplied are)
(correct.  Anyone using the part programs supplied by Renishaw)
(must ensure that the programs are suitable for the machine/controller)
(on which they are used.  Part programs should only be run by personnel)
(who are fully familiar with the machine, the controller and the)
(operation of all guards, interlocks and emergency stop switches.)
(It is recommended that programs are initially tested at low speed using)
(the feedrate override control.)

IF[#9NE#0]GOTO5
#9=3000. 
N5 

G40G69G80G90G17
#129=1 
IF[#4006EQ21]GOTO10
IF[#4006EQ71]GOTO10
#129=1/25.4
 
N10
#9=#9*#129
#7=1. 
#4=1.0*#129 

N30
G#19 
G17
G64
G98F#9 
G65P8704A1.
IF[#5041NE[#18+#4]]GOTO40
IF[#5042NE0.0]GOTO40  
GOTO80 

N40
G65P8704A1.
#100=SQRT[[#5041*#5041]+[#5042*#5042]] 
#101=SQRT[[#100*#100]+[#5043*#5043]] 
#5=#100
#6=#101
G65P8704A1.
IF[#6LT[#18*0.95]]GOTO100
IF[#6GT[#18*1.05]]GOTO100

N50
G65P8704A1.
IF[#5042NE0.0]GOTO60 
IF[#5041GT0.0]GOTO80 
IF [ #5041 EQ 0 ] AND [ #5042 EQ 0 ] GOTO80 

N60
G65P8704A1.
G17
IF[#5042GT0.0]GOTO70 
G03X[#5]Y0.0I-[#5041]J-[#5042] 
GOTO80 

N70
G65P8704A1.
G02X[#5]Y0.0I-[#5041]J-[#5042] 
N80

G65P8704A1. 
IF[#5043EQ0.0]GOTO100
G18
G65P8704A1.
IF[#5041LT0.0]GOTO90 
IF[#5043GT0.0]GOTO90 
G02X[#6]Z.0I[#5041*[-1.]]K[#5043*[-1]]
GOTO100

N90
G65P8704A1.
G03X[#6]Z.0I[#5041*[-1.]]K[#5043*[-1]]
N100 

M99

%